Telegram Group & Telegram Channel
Самый простой способ использовать модуль logging — вызывать функции напрямую, без создания объекта логгера:


import logging
logging.error('xxx')


Этот глобальный логгер можно настроить с помощью вызова logging.basicConfig():


import logging
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # -- xxx --


Однако у basicConfig есть свои ограничения. Во-первых, срабатывает только первый вызов — все последующие игнорируются. Во-вторых, любая функция, записывающая лог, может вызвать basicConfig, поэтому конфигурацию нужно задавать до любых сообщений:


import logging
logging.error('xxx') # ERROR:root:xxx
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # ERROR:root:xxx


👉@BookPython



tg-me.com/BookPython/3644
Create:
Last Update:

Самый простой способ использовать модуль logging — вызывать функции напрямую, без создания объекта логгера:


import logging
logging.error('xxx')


Этот глобальный логгер можно настроить с помощью вызова logging.basicConfig():


import logging
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # -- xxx --


Однако у basicConfig есть свои ограничения. Во-первых, срабатывает только первый вызов — все последующие игнорируются. Во-вторых, любая функция, записывающая лог, может вызвать basicConfig, поэтому конфигурацию нужно задавать до любых сообщений:


import logging
logging.error('xxx') # ERROR:root:xxx
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # ERROR:root:xxx


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/BookPython/3644

View MORE
Open in Telegram


Библиотека Python разработчика Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

Библиотека Python разработчика from cn


Telegram Библиотека Python разработчика | Книги по питону
FROM USA